import request from '@/utils/request'

// 获取列表
export function getDepartments() {
  return request({
    url: '/company/department'
  })
}

// 添加
export function addDepartments(data) {
  return request({
    method: 'post',
    url: '/company/department',
    data
  })
}

// 编辑
export function editDepartments(data) {
  return request({
    method: 'put',
    url: '/company/department/' + data.id,
    data
  })
}

// 获取部门详情
export function getDepartDetail(id) {
  return request({
    url: '/company/department/' + id
  })
}

// 删除
export function delDepartment(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'delete'
  })
}
